<template>

  <a-select
    placeholder="请选择产品分类"
    v-bind="$attrs"
    v-on="$listeners"
    :options="enumList"
    :value.sync="__proxyValue"
    label-attr-name="Name"
    val-attr-name="CategoricalId"/>

</template>

<script>
  import ASelect from '@/components/ATheFridayClub/ASelect'
  import { ProductCategoricalGetAllList, ProductPrintTypeGetAll } from '@/api/productInformation'
  import { ERR_OK } from '@/utils/commons'

  export default {
    name: 'productCategoricalSelect',
    components: { ASelect },
    props: {
      value: {
        type: [Number, String],
        require: true
      }
    },
    computed: {
      __proxyValue: {
        get() {
          return this.value
        },
        set(newValue) {
          this.$emit('update:input', newValue)
        }
      }
    },

    created() {
      this.getData()

    },

    data() {
      return {
        enumList: Array.of()
      }
    },

    methods: {
      async getData() {
        try {
          const { Code, Result } = await ProductCategoricalGetAllList()
          if (Code === ERR_OK) {
            console.log(Result.Items,'Result >>>>>>>>>>>>>>>54');
            this.enumList = Result.Items
          }
        } catch (e) {
          console.log(e);
        }
      }
    }


  }
</script>

<style lang="scss" scoped>

</style>
